<!DOCTYPE html>
<html lang="zh-CN">

<head>
	<meta charset="UTF-8">
	<title>百灵快传</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="renderer" content="webkit|ie-comp|ie-stand" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="../assets/css/main.css?02">
</head>

<body>
<div class="layui-fluid x-body">
	<blockquote class="layui-elem-quote" style="text-align: center">
		<div>手机电脑文件传输||局域网文件服务器</div>
		${range .ips}
		<div class="home-index-tips">

			<div class="home-index-tips-left">
				<a onclick="openQrcode('${.}')" title="手机扫码传输文件">
				<b><i class="iconfont">&#xe6ec;</i> ${.}</b>
				</a>
			</div>
			<div class="home-index-tips-right">
			<a href="http://${.}" target="_top" title="刷新">
				<i class="layui-icon layui-icon-refresh-3"></i>
			</a>
			<a href="http://${.}/files/" target="_top" title="列表形式">
				<i class="iconfont">&#xe6b5;</i>
			</a>
			</div>
		</div>
		${end}
	</blockquote>


	<div class="layui-row layui-col-space15">
		${range .flists}
	<div class="layui-col-xs6 layui-col-sm4 layui-col-md3 layui-col-lg2">
		<div class="layui-card bg-gray">
			<div class="layui-card-header inline-text">
				<b title="${.date}">${.indexs} .${.name}</b>
				&nbsp;
				<span onclick="deleteFile('${.path}')"
					  class="layui-badge layui-bg-gray layuiadmin-badge inline-icon">x</span>
			</div>
			<div class="layui-card-body layuiadmin-card-list">
				<p class="layuiadmin-big-font" style="text-align: center">

					<a onclick="openView('${.name}','${.path}','${.type}')">
						${if eq .type "img"}
						<img src="${.path}" height="50"  alt="${.name}"/>
						${else}
						<div class="filebox">${.ext}</div>
						${end}

					</a>

				</p>
				<p class="inline-small">
					${.date}
                    <span class="layuiadmin-span-color">
                    ${.sizes}
                    <i class="layui-inline layui-icon layui-icon-save"></i></span>
				</p>
			</div>
		</div>
	</div>
		${end}
	</div>

</div>

<script type="text/javascript" src="../js/libs/jquery.min.js "></script>
<script type="text/javascript" src="../js/libs/layui/layui.js"></script>
<script type="text/javascript" src="../js/main.js"></script>
<script type="text/javascript" src="../js/utils.js"></script>
<script>

	function openQrcode(ip){
		x_admin_open('手机扫码','./page/qrcode.html?f='+ip, 250, 320);
	}

	function openView(t,f,mtype) {
		if(mtype=="img"){
			x_open_full(t, "./page/image.html?name="+encodeURI(f));
		}else{
			//x_open_full(t, f)
			window.open(f);
		}
	}

	function deleteFile(filepath) {
		layer.confirm('确认要删除这个文件吗<br>'+filepath+'', {
			btn : [ '确定', '取消' ]//按钮
		}, function(index) {
			if(index>0){
				httpGet("/api/delete?f="+filepath, function (result) {
					messageOk("删除成功");
					window.location.reload();
				});
			}
		});
	}
</script>
</body>

</html>